The translation functions we export from extension utils must
work with all extensions, not only the first that calls one
of the functions.
That means that we are back to examining a backtrace for every
function call unless an extension defined its own translation
functions with `import.meta.url`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2887>
}
#lookupExtension(funcName) {
- if (!this.#url)
- this.#url = this.#detectUrl();
-
- const extension = this.#extensionClass.lookupByURL(this.#url);
+ const url = this.#url ?? this.#detectUrl();
+ const extension = this.#extensionClass.lookupByURL(url);
if (!extension)
throw new Error(`${funcName} can only be called from extensions`);
return extension;